Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: group key testing #717

Merged
merged 5 commits into from
Dec 9, 2023
Merged

misc: group key testing #717

merged 5 commits into from
Dec 9, 2023

Conversation

jharveyb
Copy link
Contributor

@jharveyb jharveyb commented Dec 4, 2023

Spun out of #549 . Adds a few test cases related to group key handling following the group key derivation algorithm changes and storage changes that were included in 0.3.0. We also remove some clearly-redunant error checking in proof validation.

Coverage for asset increases by 3.6% to 70.8%, for tapdb an increase of 0.2% to 66.1%, and for proof an increase of 0.4% to 56.1%.

@jharveyb
Copy link
Contributor Author

jharveyb commented Dec 6, 2023

Looks like I caused an issue in unrelated tapdb tests:

--- FAIL: TestAssetExportLog (0.71s)
    test_sqlite.go:11: Creating new SQLite DB for testing
    assets_store_test.go:1455: 
        	Error Trace:	/home/runner/work/taproot-assets/taproot-assets/tapdb/assets_store_test.go:1455
        	Error:      	Not equal: 
        	            	expected: 0x1
        	            	actual  : 0x0
        	Test:       	TestAssetExportLog
FAIL
FAIL	github.com/lightninglabs/taproot-assets/tapdb	9.782s
FAIL

@jharveyb jharveyb linked an issue Dec 6, 2023 that may be closed by this pull request
In this commit, we update multiple unit tests to not set an asset group
key directly, and instead use some test helper that calls asset.New().
This ensures that the group witness is copied into the asset. The only
time setting the group key directly is acceptable is before a group
witness has been created, or in a minting request.
@jharveyb
Copy link
Contributor Author

jharveyb commented Dec 8, 2023

Fixed unit flake, asset version wasn't being passed properly.

Not sure why go.mod has a change.

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Nice work bumping up the test coverage 😎

Witness: a.GroupKey.Witness,
RawKey: a.GroupKey.RawKey,
GroupPubKey: a.GroupKey.GroupPubKey,
TapscriptRoot: a.GroupKey.TapscriptRoot,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Roasbeef Roasbeef merged commit 6a18d30 into main Dec 9, 2023
13 of 14 checks passed
@guggero guggero deleted the group_key_testing branch December 11, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[feature]: increase group key testing
3 participants